package com.memory.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.memory.common.BaseContext;
import com.memory.dao.OrderDao;
import com.memory.daomain.Orders;
import com.memory.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 邓哈哈
 * 2023/2/2 19:56
 * Function:
 * Version 1.0
 */

@Service
public class OrderServiceImpl extends ServiceImpl<OrderDao, Orders> implements OrderService {
    @Autowired
    private OrderDao OrderDao;

    @Override
    public Page<Orders> getPage(Integer page, Integer pageSize) {
//        Long currentId = BaseContext.getCurrentId();

        Page<Orders> OrderPage = new Page<>(page, pageSize);

//        LambdaQueryWrapper<Order> lqw = new LambdaQueryWrapper<>();
//        lqw.eq(Order::, currentId);

        Page<Orders> selectPage = OrderDao.selectPage(OrderPage, null);

        return selectPage;
    }
}
